/*
 * NxPSDetectLeader.java
 *
 * Created on 10 de noviembre de 2007, 08:09 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package nx2.behaviors;
import nx2.robot.*;
import nx2.utils.*;
import nx2.behaviors.*;
import javaclient2.*;
import javaclient2.structures.*;
/**
 *
 * @author alejo
 *
 * Class used to implement a Perceptual NxBehavior that identifies the position
 * of the leader.
 */
public class NxPSDetectLeader extends NxBehavior{
    
    Position2DInterface leaderPosition;
    /** Creates a new instance of NxPSDetectLeader */
    public NxPSDetectLeader(String name,Position2DInterface leaderPosition) {
        super(name);
        this.leaderPosition = leaderPosition;
    }
    
    
    public Vector2D value() {
        
        PlayerPose leaderPose = leaderPosition.getData().getPos();
        return new Vector2D(leaderPose.getPx(),leaderPose.getPy(),Vector2D.MODE_XY);
    }
}
